<template>
	<!-- mine/pages/personalAccount/personalAccount.wxml -->
	<view class="personalBox" :style="objColor">
		<customer></customer>
		<!--通知栏-->
		<template v-if="czjlDetail">
			<!-- 着急上线暂时隐藏 -->
			<view class="rechargeMessage" v-if="activeTitle">
				<view class="btn">充值优惠</view>
				<view class="title">{{activeTitle}}</view>
				<view class="info" @tap="toPayAward">查看详情 ></view>
			</view>
		</template>


		<!-- 营销获客充值 -->
		<view class="setting">
			<view class="setting_title">
				<view>充值金额</view>
				<view class="tips">充值金额可能出现延迟到账情况，请稍作等待</view>
			</view>
			<view class="custom">
				<text class="icon">￥</text>
				<input class="custom_input" type="digit" v-model="customRechargePrice" @input="getCustomPrice"
					placeholder="输入充值金额" />
				<image src="https://oos-cn.ctyunapi.cn/front-end/static/static/delete.png" @tap="clearPrice"
					v-show="!!customRechargePrice"></image>
			</view>
			<view class="priceType">
				<view class="type" :class="[
            priceType == index ? 'type_action' : '',
          ]" v-for="(item, index) in priceTypeList" :key="index" @click="checkPriceType(item,index)">
					{{ item.price }}<text class="icon1">元</text>
					<image class="select" :src="
              (mixRechargeIconList[1] && mixRechargeIconList[1].icon) ||
              'https://oos-cn.ctyunapi.cn/front-end/static/static/checkbox_sel2.png'
            " v-show="priceType == index"></image>
					<image v-if="item.status == '1' " class="tips" style="width: 100rpx" mode="widthFix"
						:src="labelIcon"></image>
				</view>
			</view>
		</view>

		<!--充值奖励-->
		<view class="gift" v-if="rechargeItemShow">
			<view class="t1">充值奖励</view>
			<view class="giftBox">
				<view class="giftItem" v-if="rechargeItem.bonusNum">￥{{rechargeItem.bonusNum}}元奖励金</view>
				<template v-if="rechargeItem.cardNum1">
					<view class="giftItem" v-for="item in rechargeItem.cardNum1.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.cardNum2">
					<view class="giftItem" v-for="item in rechargeItem.cardNum2.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.cardNum3">
					<view class="giftItem" v-for="item in rechargeItem.cardNum3.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.cardNum4">
					<view class="giftItem" v-for="item in rechargeItem.cardNum4.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.couponNum1">
					<view class="giftItem" v-for="item in rechargeItem.couponNum1.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.couponNum2">
					<view class="giftItem" v-for="item in rechargeItem.couponNum2.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.couponNum3">
					<view class="giftItem" v-for="item in rechargeItem.couponNum3.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.couponNum4">
					<view class="giftItem" v-for="item in rechargeItem.couponNum4.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.couponNum5">
					<view class="giftItem" v-for="item in rechargeItem.couponNum5.split(',')">{{item}}</view>
				</template>

				<template v-if="rechargeItem.integralNum">
					<view class="giftItem" v-for="item in rechargeItem.integralNum.split(',')">{{item}}</view>
				</template>

				<view class="giftItem" v-if="rechargeItem.equityNum">权益数量 x {{rechargeItem.equityNum}}</view>
			</view>
		</view>

		<!--移动端优化 充值说明-->
		<view class="gift" style="margin-top: 40rpx" v-if="refundAmountInfoExplain">
			<view class="t1">充值说明</view>
			<view class="czsm_box">
				<view>{{ refundAmountInfoExplain }}</view>
			</view>
		</view>

		<!--充值方式-->
		<view class="payType">
			<view class="title">支付方式</view>
			<view class="box">
				<!-- <template></template> -->
				<template v-for="(item, index) in payTypeList">
					<view class="item" @click="switchPayType(item.value)" :data-value="item.value" v-if="item.show">
						<image :src="item.src" class="icon"></image>
						<view class="it">
							<view class="t1">{{ item.name }}</view>
							<view class="t2">{{ item.tip }}</view>
							<image :src="
                  payType == item.value
                    ? sellerNo == 'jw'
                      ? 'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/checkbox_sel-blue.png'
                      : 'https://oos-cn.ctyunapi.cn/front-end/static/static/checkbox_sel.png'
                    : 'https://oos-cn.ctyunapi.cn/front-end/static/static/checkbox.png'
                "></image>
						</view>
					</view>
				</template>
			</view>
		</view>

		<view class="record" @tap="goReRecord">充值记录</view>

		<!--充值按钮-->
		<view class="setting_btn">
			<view class="btn" @tap="toCharge1">立即充值</view>
		</view>

		<!-- 充值说明 -->
		<u-popup :show="showExplain" :round="20" mode="center" @close="onCloseExplain" v-if="marketingSwitch">
			<view class="explain" style="
          padding: 32rpx 32rpx 90rpx 32rpx;
          width: 702rpx;
          box-sizing: border-box;
          mix-height: 350rpx;
        ">
				<view class="title">充值优惠说明</view>
				<rich-text :nodes="refundAmountInfo"></rich-text>
				<view style="height: 108rpx"></view>
				<view class="pupBtn" @tap="onCloseExplain">知道了</view>
			</view>
		</u-popup>
		<!-- 	<u-popup :show="showExplain" :round="20" mode="center" @close="onCloseExplain" v-else>
	    <view class="explain" style="
	      padding: 32rpx 32rpx 90rpx 32rpx;
	      width: 702rpx;
	      box-sizing: border-box;
	      mix-height: 350rpx;
	    ">
	        <view class="title">充值优惠说明</view>
	        <rich-text :nodes="refundAmountInfo"></rich-text>
	        <view style="height: 108rpx"></view>
	        <view class="pupBtn" @tap="onCloseExplain">知道了</view>
	    </view>
	</u-popup> -->
	</view>
</template>

<script>
	'use strict';
	import Upgrading from '../../../components/upgrading/upgrading';
import Payment from '@/components/payment/payment';

	// exports.__esModule = true; // mine/pages/personalAccount/personalAccount.ts

	var app = getApp();
	var find_1 = require('../../../api/find.js');
	var https_1 = require('./../../../api/https.js');

	import {
	getRechargeRewardMemo,
	rechargeRewardsList,
	getRechargeRewardsDetail
} from '../../../api/marketing/rechargeApi';
import {
	recharge,
	rechargeBefore,
	firstRewardSendRecharge,
} from '../../../api/marketing/marketing';
import {
	getSellerPayConfigBySellerId,
	nengYinPayUnifiedOrder,
	nengYinPayCancelRecharge,
	nengYinPayOrderQuery
} from '@/api/apiServe';
import {
	outTradeNo
} from '../../../api/wxHttp';
import {
	getQueryData,
	setOptionsToUrlQuery,
	setNewTagObject,
	getNewTagObject
} from '@/utils/util';
	const dayjs = require('../../../utils/dayjs.min.js');
	//#ifdef H5
	import { toCDGJWechatMiniPay, toCDGJH5UrlPay } from '@/utils/h5.js';
	//#endif

	export default {
		components: {
			Upgrading,
			Payment
		},
		computed: {
			rechargeItemShow() {
				return this.rechargeItemShowFn()
			}
		},
		data() {
			return {
				zfbShow: false,
				labelIcon: `${app.globalData.imgUrl}/group1/image/label6743894906767080473.png`,
				sellerNo: app.globalData.sellerNo,
				showBalanceFreeze: false,
				showJiangLiBalanceFreeze: false,
				accountType: 1,
				showExplain: false,
				accountInfo: {
					accountBalance: '',
					balanceFreeze: '',
					jiangLiBalance: '',
					jiangLiBalanceFreeze: '',
					deductMode: ''
				},
				refundAmountInfo: "",
				payType: 'isusexcx',
				payTypeList: [
					// 微信支付
					{
						name: '微信支付',
						tip: '推荐微信用户使用',
						src: 'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/refund_wx.png',
						value: 'isusexcx',
						show: true
					},
					// 欧昊微信支付
					{
						name: '微信支付',
						tip: '推荐微信用户使用',
						src: 'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/refund_wx.png',
						value: 'isusebhPay',
						show: false
					},
					// 能银微信支付
					{
						name: '微信支付',
						tip: '推荐微信用户使用',
						src: 'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/refund_wx.png',
						value: 'isUseNyPay',
						show: false
					},
					// 农行支付
					{
						name: '农行支付',
						tip: '推荐农行用户使用',
						src: 'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/refund_abc.jpg',
						value: 'isuseABCPay',
						show: false
					},
					// 支付宝支付
					{
						name: '支付宝支付',
						tip: '推荐支付宝用户使用',
						src: 'https://oos-cn.ctyunapi.cn/front-end/static/mine/images/refund_zfb.png',
						value: 'isusezfb',
						show: false
					},
				],
				priceType: 0,
				customRechargePrice: 0,
				priceTypeList: [],

				//收支记录
				recordsList: [],
				giftList: [],
				orderNo: '',
				outTradeNo: '',
				Interval: null,

				//营销获客 充值活动
				czjlDetail: null,
				activeTitle: null,

				// 充值统计参数
				rechargeQuery: {
					joinChannel: 3,
					//:0:iosapp;1:安卓app;2:微信公众号;3:小程序;
					rechargeAmount: 0,
					//	充值金额
					rechargeTime: '',
					//充值时间 yyyy-MM-dd HH:mm:ss,
					sellerId: app.globalData.sellerId //商家ID
				},
				//充值说明
				refundAmountInfoExplain: "",
				payApi: {
					unifiedOrders: https_1.unifiedOrders,
					orderResultQuery: https_1.orderResultQuery,
					cancelRecharge: https_1.unifiedOrders,
					aliUnifiedOrders: https_1.aliUnifiedOrders,
				},
				rechargeItem: {},
				sellerConfig: {},
				payTime1: null,
				isH5PayCallback: false, // 是否是H5支付回调
				clientType: '',
				appH5Time: null,
				h5Redirect: false, // H5支付成功后重定向
				isGoBack: false, // 是否充值成功或失败就返回上一页
				goBackTime: null,
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad: function(options) {
			// #ifdef MP-ALIPAY
			this.zfbShow = true
			// #endif
			console.log('-----options-----', options);
			this.isGoBack = options.goBack ? true : false

			// this.marketingSwitch = false
			if (options.tab) {
				this.accountType = options.tab
			}
			if (options.type === 'active2') {
				this.getFindRead2(options.id);
			}

			getSellerPayConfigBySellerId(getApp().globalData.sellerId).then(res => {
				console.log('这是商家配置11', res)
				if (res.code == 0) {
					let {
						isusexcx,
						isusebhPay,
						isUseNyPay,
						isuseABCPay,
						isusezfb
					} = res.data || {}
					this.mchid = res.data.xcxmerchantNumber
					this.sellerConfig = res.data || {}
					if (isusebhPay) {
						console.log('昊易充微信支付')
						this.switchPayType('isusebhPay')
					} else if (isUseNyPay) {
						console.log('能银微信支付')
						this.switchPayType('isUseNyPay')
					} else if (isusezfb && this.zfbShow) {
						// 只有在支付宝小程序才能显示支付宝支付
						this.switchPayType('isusezfb')
						console.log('支付宝支付')
					} else {
						console.log('传统微信支付')
						this.switchPayType('isusexcx')
					}

					// 农行支付  
					// #ifdef APP-PLUS
					if (isuseABCPay) {
						this.payTypeList.find(item => item.value == 'isuseABCPay').show = true
					}
					//#endif
				}
			})

			this.getRechargeRewardsList();

			// #ifdef H5
			this.clientType = uni.getStorageSync('clientType') || ''
			if (this.isCdgj()) {
				this.h5Redirect = options.h5Redirect ? true : false
			}
			// 查询充值结果
			if (options.isH5PayCallback && this.isCdgj()) {
				this.isH5PayCallback = true
				this.orderNo = options.orderNo || ''
				this.customRechargePrice = options.customRechargePrice || 0
				this.payErr = options.status == 'fail' ? true : false // 是否支付失败
				this.rechargeQuery = getNewTagObject(options, 'RQ_')
				console.log('----this.rechargeQuery---', this.rechargeQuery);
				this.getRechargeResult()

				// APP 端
				if (this.clientType == 'APP') {
					// 1分钟内，超时就自动取消查询
					this.appH5Time = setTimeout(() => {
						this.payErr = true;
					}, /* 60000 */ 10000)
				}
			}
			// #endif
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady: function() {},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			let token = uni.getStorageSync('token');
			if (!token) {
				return;
			}

			if (this.marketingSwitch) {
				this.getPayAwardMsg();
			}
			// 充值说明
			this.getRefundAmountExplain();
			
			// 未支付页面处理
			this.stopPay()
		},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide: function() {
			clearTimeout(this.payTime1);
		},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload: function() {
			clearTimeout(this.payTime1);
		},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh: function() {},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom: function() {},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage: function() {},
		methods: {
			// 用户未支付返回当前应用处理
			stopPay() {
				// #ifdef APP-PLUS
				// 农行支付没有成功
				if (this.payType == 'isuseABCPay') {
					setTimeout(() => {
						// 判断是否在轮询中
						if (this.rechargeLoading) {
							this.payErr = true
						}
					}, 4000)
				}
				// #endif
			},

			rechargeItemShowFn() {
				let rechargeItem = this.rechargeItem
				return (rechargeItem.bonusNum || rechargeItem.cardNum1 || rechargeItem.cardNum2 || rechargeItem.cardNum3 ||
					rechargeItem.cardNum4 || rechargeItem.couponNum1 || rechargeItem.couponNum2 || rechargeItem
					.couponNum3 || rechargeItem.couponNum4 || rechargeItem.couponNum5 || rechargeItem.equityNum ||
					rechargeItem.integralNum)
			},
			getRechargeRewardsList() {
				if (!this.marketingSwitch) {
					// 基础平台价格写死
					this.priceTypeList = [{
						price: 50
					}, {
						price: 100
					}, {
						price: 200
					}, {
						price: 300
					}, {
						price: 600
					}, {
						price: 1000
					}]
					this.customRechargePrice = this.rechargeItem?.price || 50
					return
				}

				let data = {
					plUserId: "",
					userType: "",
					cityId: uni.getStorageSync('cityId1')
				}
				rechargeRewardsList(data).then(res => {
					if (res.code == 200) {
						this.priceTypeList = res.data || [];
						this.rechargeItem = res.data && res.data[0] || null;
						this.customRechargePrice = this.rechargeItem?.price || 50
					}
				})
			},
			// 优惠说明
			getRefundAmountExplain() {
				https_1.getContent2('PLATFORM_CHARGE').then(res => {
					if (res.code == 0) {
						this.refundAmountInfoExplain = res.data;
					}
				});
			},
			//获取充值活动
			getPayAwardMsg() {
				let userInfo = uni.getStorageSync('userInfo');
				console.log(userInfo);
				if (userInfo.memberType == 0) {
					this.userTypes = '1';
				} else {
					this.userTypes = '2';
				}
				getRechargeRewardMemo({
						plUserId: uni.getStorageSync('memberId'),
						userType: this.userTypes,
						cityId: uni.getStorageSync('cityId1')
					})
					.then((res) => {
						if (res.code == 200) {
							console.log(res.data, '获取充值活动........');
							this.setData({
								czjlDetail: res.data
							});
							this.getHdDetail(res.data.activityId)
						}
					})
					.catch((err) => {
						console.log(err);
					});
			},
			//获取站充值奖励活动详情
			getHdDetail(id) {
				//获取充值活动详情
				getRechargeRewardsDetail({
						id: id,
						plUserId: uni.getStorageSync('memberId')
					})
					.then((res) => {
						if (res.code == 200) {
							this.setData({
								activeTitle: res.data.activityDetail.name
							});
						} else {
							console.log('返回不是200了');
						}
					})
					.catch((err) => {
						console.log(err);
					});
			},
			toPayAward() {
				uni.navigateTo({
					url: '/marketing_page/pages/pay/payAward/payAward?HD=' + `${this.czjlDetail.activityId}`
				});
			},

			showJiangLiBalanceFreezeFun: function() {
				this.showJiangLiBalanceFreeze = !this.showJiangLiBalanceFreeze
			},
			getFindRead2: function(id) {
				find_1.addReadNumber(id).then(function(res) {
					if (res.code == 0) {
						console.log(res);
					}
				});
			},
			getRefundAmount: function(sonEnum) {
				var that = this;
				https_1.getContent2('REFILL_DISCOUNT').then(function(res) {
					if (res.code == 0) {
						var data = res.data;
						that.refundAmountInfo = data
						if (data) {
							this.marketingSwitch = true
						}
					}
				});
			},
			getRechargeDiscounts: function() {
				var that = this;
				https_1.getRechargeDiscounts().then((res) => {
					if (res.code == 0) {
						let arr = res.data
						arr.forEach(item => {
							this.priceTypeList.forEach(its => {
								if (its.value === item / 100) {
									its.flag = true
								}
							})
						})
						// console.log(res.data)
					}
				});
			},
			// 基础平台 
			getRechargeAwardExplain: function(price) {
				var that = this;
				var balance = (price * 1 * 100) || 0
				https_1.getRechargeAwardExplain({
					memberId: uni.getStorageSync('memberId'),
					sellerId: app.globalData.sellerId,
					balance: balance.toFixed(0),
				}).then((res) => {
					if (res.code == 0) {
						this.giftList = res.data || []
						console.log(res.data)
					}
				});
			},
			onCloseExplain: function(toChange) {
				this.showExplain = false
				if (this.payFlag) {
					this.toCharge()
					this.payFlag = false
				}
			},

			showBalanceFreezeFun: function() {
				this.showBalanceFreeze = !this.showBalanceFreeze
			},
			clearPayType() {
				this.payTypeList.forEach(item => {
					item.show = false
				})
			},
			switchPayType(payType) {
				this.payType = payType
				this.payTypeList.find(item => item.value == payType).show = true
				if (this.payType == 'isusexcx') {
					// 微信支付
					this.payApi = {
						unifiedOrders: https_1.unifiedOrders,
						orderResultQuery: https_1.orderResultQuery,
						cancelRecharge: https_1.unifiedOrders,
					}
					// 只有微信支付不用清
				} else if (this.payType == 'isusebhPay') {
					// 欧昊支付
					this.payApi = {
						unifiedOrders: https_1.bhPayUnifiedOrder,
						orderResultQuery: https_1.bhPayOrderQuery,
						cancelRecharge: https_1.bhPayCancelRecharge,
					}
					this.clearPayType()
				} else if (this.payType == 'isUseNyPay') {
					// 能银支付
					this.payApi = {
						unifiedOrders: nengYinPayUnifiedOrder,
						orderResultQuery: nengYinPayOrderQuery,
						cancelRecharge: nengYinPayCancelRecharge,
					}
					this.clearPayType()
				} else if (this.payType == "isusezfb") {
					console.log("支付宝支付------------")
					this.clearPayType()
					this.payTypeList.find(item => item.value == payType).show = true
				}
				// 农行支付保留微信支付  不调用clearPayType()
				if (this.payType == 'isuseABCPay') {
					console.log('农行支付')
					// 农行支付
					this.payApi = {
						unifiedOrders: https_1.ABCPayUnifiedOrders,
						orderResultQuery: https_1.ABCPayOrderQuery,
						cancelRecharge: https_1.unifiedOrders,
					}
				}
			},
			clearPrice() {
				this.customRechargePrice = null
			},

			//选择充值类型
			checkPriceType(row, index) {
				console.log(row)
				this.rechargeItem = row;
				this.priceType = index;
				this.customRechargePrice = row.price;
			},
			//输入时触发（自定义充值金额）
			getCustomPrice: function(e) {
				let priceTypeList = this.priceTypeList
				var num = e.detail.value;
				var x = String(num).indexOf('.') + 1; //得到小数点的位置
				if (x) {
					var y = String(num).length - x; //小数点的位数
					if (y > 2) {
						var that_1 = this;
						uni.showModal({
							title: '消息提示',
							content: '自定义金额小数位不能大于2位',
							showCancel: false,
							success: function(res) {
								if (res.confirm) {
									that_1.priceType = 0
									that_1.customRechargePrice = priceTypeList[0].price
								}
							}
						});
					}
				}
				this.customRechargePrice = e.detail.value

				this.priceType = priceTypeList.findIndex((item) => item.price == this.customRechargePrice)
				// this.rechargeItem = priceTypeList[this.priceType] || null
			},
			// APP唤起微信授权
			wxGetUserInfo() {
				let that = this
				return new Promise((resolve, reject) => {
					uni.getProvider({
						service: 'oauth',
						success: function(res) {
							if (~res.provider.indexOf('weixin')) {
								uni.login({
									provider: 'weixin',
									success: function(loginRes) {
										uni.getUserInfo({
											provider: 'weixin',
											success: function(infoRes) {
												let userInfo = {
													...infoRes.userInfo,
													...loginRes.authResult
												}
												resolve(userInfo)
												uni.setStorageSync('openId',
													userInfo.openId)
												uni.setStorageSync('unionId',
													userInfo.unionId)
												that.toCharge()
												console.log(userInfo, '用户信息');
											},
											fail(err) {
												reject(err)
												console.log(err,
													'getUserInfoError')
											}
										})
									},
									fail(err) {
										reject(err)
										console.log(err, 'loginError')
									}
								})
							}
						},
						fail(err) {
							reject(err)
							console.log(err, 'getProviderError')
						}
					})
				})
			},
			toCharge1() {
				console.log(this.marketingSwitch, 'this.marketingSwitch')
				if (this.marketingSwitch) {
					// 着急上线暂时隐藏
					// if (this.rechargeItemShowFn()) {
					//     this.showExplain = true
					// 	this.payFlag = true
					// } else {
					//     this.toCharge()
					// }

					this.toCharge(true)
				} else {
					if (this.giftList.length) {
						this.showExplain = true
						this.payFlag = true
					} else {
						this.toCharge(true)
					}
				}
			},
			//立即充值
			async toCharge(knowType) {
				// return wx.removeStorageSync('openId')
				var that = this;
				var chargePrice = 0;
				if (that.customRechargePrice !== '' && that.customRechargePrice > 0) {
					chargePrice = that.customRechargePrice * 100;
				} else {
					uni.showToast({
						title: '请选择充值金额',
						icon: 'none'
					});
					return false;
				}
				if (knowType === true && this.priceType != -1) {
					let explainText = this.priceTypeList[this.priceType].explainText
					console.log(this.priceTypeList[this.priceType])
					console.log(explainText, 'priceType')
					if (explainText) {
						this.refundAmountInfo = explainText
						this.showExplain = true
						this.payFlag = true
						return
					}
					// await this.getRechargeAwardExplain(chargePrice);
					// console.log(this.priceType, 'priceType')
				}
				//#ifdef MP-WEIXIN || MP-ALIPAY
				let type = 'JSAPI'
				let openId = uni.getStorageSync("openId")
				uni.hideLoading();

				//#endif

				//#ifdef APP-PLUS
				let type = 'APP'
				let openId = uni.getStorageSync("openId")
				// 是否开启农行支付
				if (!that.sellerConfig.isuseABCPay) {
					that.switchPayType('isusexcx')
				}
				//#endif

				//#ifdef H5
				let type = 'JSAPI'
				let openId = uni.getStorageSync("wxGzhOpenid")
				if (that.isxmgjMix()) {
					openId = uni.getStorageSync("openId")
				} else if (that.isCdgj()) {
					// 成都公交
					openId = uni.getStorageSync("openId") || null
					if (that.clientType == 'APP') {
						type = 'MWEB' // 内嵌APP端
					}
				}
				
				if (this.isCYCAPPInH5()) {
					// #川逸充app内嵌h5
					type = 'MWEB'
				}
				//#endif

				if (this.rechargeLoading) {
					return
				}
				// 支付中...状态
				that.rechargeLoading = true

				// #ifndef MP-ALIPAY
				this.payApi
					.unifiedOrders({
						openId: openId, // oGIXrv6BHN7TW8s_5G_u7zwlgl_4
						totalFee: chargePrice,
						tradeType: type, // 交易类型：JSAPI -JSAPI支付 NATIVE -Native支付 APP -APP支付
					})
					.then((res) => {
						console.log("进入app充值1", res.code, uni.getStorageSync('openId'))

						if (res.code == 0) {
							//微信
							//#ifdef MP-WEIXIN
							var getpar = {
								timeStamp: res.data.timeStamp,
								nonceStr: res.data.nonceStr,
								package: res.data.package,
								paySign: res.data.sign || res.data.paySign,
								orderNo: res.data.orderNo
							};
							//#endif

							//APP
							//#ifdef APP-PLUS
							if (this.payType == 'isuseABCPay') {
								res.data.orderNo = res.data.OrderNo // 农行-返回的订单号字段为 OrderNo
							}
							console.log("进入app充值", res.data)
							var getpar = {
								appid: res.data.appid, // 微信开放平台 - 应用 - AppId，注意和微信小程序、公众号 AppId 可能不一致
								noncestr: res.data.noncestr, // 随机字符串
								package: res.data.package, // 固定值
								partnerid: res.data.partnerid, // 微信支付商户号
								prepayid: res.data.prepayid, // 统一下单订单号
								timestamp: res.data.timestamp, // 时间戳（单位：秒）
								sign: res.data.sign, // 签名，这里用的 MD5/RSA 签名
								PaymentURL: res.data.PaymentURL, //农行支付地址
							};
							//#endif


							//#ifdef H5
							if (that.isxmgjMix()) {
								var getpar = {
									timeStamp: res.data.timeStamp,
									nonceStr: res.data.nonceStr,
									package: res.data.package,
									paySign: res.data.sign || res.data.paySign,
									orderNo: res.data.orderNo
								};
								wx.miniProgram.postMessage({
									data: {
										type: 'pay',
										payData: getpar
									}
								})
								wx.miniProgram.redirectTo({
									url: '/pages/web1/web1'
								})
							} else if (that.isCdgj()) {
								// 成都公交
								// 营销获客处理
								if (that.marketingSwitch) {
									that.rechargeQuery.rechargeAmount = chargePrice;
									that.rechargeQuery.sellerId = app.globalData.sellerId;
									that.rechargeQuery.rechargeTime = dayjs().format(
										'YYYY-MM-DD HH:mm:ss');
									that.rechargeQuery.orderNo = res.data.orderNo;
									that.rechargeQuery.cityId = uni.getStorageSync('cityId1')
									that.rechargeBefore();
								}
								console.log('----that.rechargeQuery----', that.rechargeQuery);

								const temp_rechargeQuery = setNewTagObject(that.rechargeQuery, 'RQ_')
								const params = {
									orderNo: res.data.orderNo,
									customRechargePrice: that.customRechargePrice,
									...temp_rechargeQuery,
									isH5PayCallback: 1,
								}

								if (that.h5Redirect) {
									params.h5Redirect = true
								}
								
								const callbackUrl = encodeURIComponent(`${app.globalData.imgUrl}/h5/${app.globalData.sellerNo}/#/mine/pages/recharge/recharge${setOptionsToUrlQuery(params)}`);

								if (that.clientType == 'WeChat') {
									// H5 内嵌微信小程序端 
									toCDGJWechatMiniPay(res.data, callbackUrl)
								} else {
									// H5 内嵌APP端 
									toCDGJH5UrlPay(res.data, callbackUrl)
								}
								return
							}
							//#endif

							if (this.marketingSwitch) {
								//   营销获客处理
								setTimeout(() => {
									that.rechargeQuery.rechargeAmount = chargePrice;
									that.rechargeQuery.sellerId = app.globalData.sellerId;
									that.rechargeQuery.rechargeTime = dayjs().format(
										'YYYY-MM-DD HH:mm:ss');
									that.rechargeQuery.orderNo = res.data.orderNo;
									that.rechargeQuery.cityId = uni.getStorageSync('cityId1')
									that.rechargeBefore();
								})
							}

							that.orderNo = res.data.orderNo
							that.gopay(getpar);
						} else {
							uni.showModal({
								title: '消息提示',
								content: res.msg,
								showCancel: false,
								success(res1) {
									if (res1.confirm) {
										that.rechargeLoading = false
									}
								}
							});
						}
					});

				// #endif

				// #ifdef MP-ALIPAY
				this.payApi.aliUnifiedOrders({
					openId: openId, // oGIXrv6BHN7TW8s_5G_u7zwlgl_4
					totalFee: chargePrice,
					tradeType: type,
				}).then((res) => {
					console.log("进入app充值1", res.code, uni.getStorageSync('openId'))

					if (res.code == 0) {
						var getpar = {
							tradeNO: res.data.orderNo,
							outTradeNo: res.data.outTradeNo
						};
						if (this.marketingSwitch) {
							//   营销获客处理
							setTimeout(() => {
								that.rechargeQuery.rechargeAmount = chargePrice;
								that.rechargeQuery.sellerId = app.globalData.sellerId;
								that.rechargeQuery.rechargeTime = dayjs().format(
									'YYYY-MM-DD HH:mm:ss');
								that.rechargeQuery.orderNo = res.data.orderNo;
								that.rechargeQuery.cityId = uni.getStorageSync('cityId1')
								that.rechargeBefore();
							})
						}

						that.orderNo = res.data.orderNo
						that.outTradeNo = res.data.outTradeNo
						that.gopay(getpar);
					} else {
						uni.showModal({
							title: '消息提示',
							content: res.msg,
							showCancel: false,
							success(res1) {
								if (res1.confirm) {
									that.rechargeLoading = false
								}
							}
						});
					}
				});

				// #endif
			},
			//取消充值 -- 支付前
			cancelCharge: function() {
				const that = this
				let tradeType = 'APP' // 原来代码默认

				//#ifdef H5
				tradeType = 'JSAPI'
				if (that.isCdgj() && that.clientType == 'APP') {
					tradeType = 'MWEB'
				}
				//#endif
				this.payApi.cancelRecharge({
						openId: that.clientType == 'APP' ? undefined : uni.getStorageSync('openId'),
						totalFee: this.customRechargePrice * 100,
						tradeType: tradeType,
						orderNo: this.orderNo,
						cancelRecharge: 2
					})
					.then((res) => {
						if (res.code == 0) {
							that.rechargeLoading = false
							that.rechargeError = true
							that.isPay = false
							uni.hideLoading()

							// #ifdef H5
							if (that.isCdgj() && that.h5Redirect) {
								// H5支付重定向
								uni.showModal({
									title: '消息提示',
									content: '已取消充值',
									confirmText: '放回上一页',
									confirmColor: that.objColor2.textColor,
									showCancel: false,
									success: function (res) {
										if (res.confirm) {
											const redirectUrl = uni.getStorageSync('RECHARGE_REDIRECT_URL')
											if (redirectUrl) {
												uni.redirectTo({
													url: redirectUrl
												})
											}
										}
									}
								});
								return
							}
							// #endif

							uni.showModal({
								title: '消息提示',
								content: '已取消充值',
								confirmColor: that.objColor2.textColor,
								showCancel: false
							});
						}
					});
			},
			//取消充值 -- 支付后
			onCancelRecharge: function() {
				var that = this;
				https_1
					.cancelRecharge({
						orderNo: this.orderNo
					})
					.then(function() {
						that.rechargeLoading = false
						that.rechargeError = true

						uni.showToast({
							title: '充值失败',
							icon: 'none'
						});
					});
			},
			//调起支付
			gopay: function(data, data_o) {
				var that = this;
				that.getRechargeResult();
				//#ifdef APP-PLUS
				// 判断是不是农行支付
				if (this.payType == 'isuseABCPay') {
					try {
						const tokenID = getQueryData(data.PaymentURL).TOKEN
						const baseErrMsg = '使用农行app支付失败，请重试或选择其他支付方式'
						if (!tokenID) {
							uni.showModal({
								title: '温馨提示',
								content: baseErrMsg,
								showCancel: false
							})
							that.payErr = true
							return
						}

						const systemInfo = uni.getSystemInfoSync();
						console.log('---APP-农行支付---', tokenID);

						if (systemInfo.platform == 'android') {
							// 安卓 端农行支付处理逻辑
							const BankABCCaller = plus.android.importClass(
								"com.example.caller.BankABCCaller") // 使用农行SDK
							// 获取 callbackID
							// var callbackID = plus.bridge.callbackId();
							// console.log('callbackID', callbackID);
							console.log('BankABCCaller::::', BankABCCaller);
							const mainActivity = plus.android.runtimeMainActivity() // 获取应用主Activity实例对象
							const isAvailable = BankABCCaller.isBankABCAvaiable(mainActivity); // 检测是否安装中国农业银行APP
							if (isAvailable) {
								/**
								 * 检测到已安装，唤醒农行支付App
								 * startBankABC 对应参数：
								 * 参数1. Activity：主体
								 * 参数2. AppID: 第三方APP的应用标识。iOS无此项内容，值为空；Android为第三方apk的包名。
								 * 参数3. CallbackID: 支付完成后回调用的id。iOS为第三方app的schema，Android 为第三方APP目标页面的activity。【注：传给农行支付成功后没有数据返回】
								 * 参数4. Method：业务类型。目前支持的取值仅为pay，表示是支付交易
								 * 参数5. TokenID：支付订单号(后端返回)
								 */
								const packageName = mainActivity.getPackageName() // 获取应用包名
								BankABCCaller.startBankABC(mainActivity, packageName, packageName, "pay", tokenID);
							} else {
								// 未安装，提示用户安装
								uni.showModal({
									title: '温馨提示',
									content: '唤醒中国农业银行APP失败，请检查是否安装',
									showCancel: false
								})
							}

						} else if (systemInfo.platform == 'ios') {
							// ios 端农行支付处理逻辑。。。
							console.log('ios 端农行支付处理逻辑。。。');
						}
					} catch (err) {
						console.error('====使用农行app支付失败=====', err);
						uni.showModal({
							title: '提示',
							content: baseErrMsg,
							showCancel: false
						})
						that.payErr = true
					}

					return
				}
				var _data = JSON.stringify(data)
				uni.requestPayment({
					provider: 'wxpay',
					orderInfo: _data, //微信、支付宝订单数据 【注意微信的订单信息，键值应该全部是小写，不能采用驼峰命名】
					fail: function(err) {
						// 定义支付失败状态
						that.payErr = true
					}
				});
				//#endif

				//微信小程序
				//#ifdef MP-WEIXIN
				uni.requestPayment({
					timeStamp: data.timeStamp + '',
					nonceStr: data.nonceStr,
					package: data.package,
					signType: data.signType || 'MD5',
					paySign: data.paySign,
					fail: function(err) {
						// 定义支付失败状态
						that.payErr = true
					}
				});
				//#endif

				// #ifdef MP-ALIPAY
				my.tradePay({
					// 调用统一收单交易创建接口（alipay.trade.create），获得返回字段支付宝交易号 trade_no
					tradeNO: data.tradeNO,
					success: res => {
						console.log('调用 my.tradePay 成功: ', JSON.stringify(res));
						if(res.resultCode != 9000){
							// 定义支付失败状态
							that.payErr = true
						}
					},
					fail: error => {
						// 定义支付失败状态
						that.payErr = true
						console.error('调用 my.tradePay 失败: ', JSON.stringify(error));

					},
				});
				// #endif

				// 微信公众号
				//#ifdef H5
				that.wxGzhPay(data_o)
				//#endif
			},
			wxGzhPay(data_o) {
				let that = this
				if (that.sellerNo == 'changzhi') {
					// 使用农行支付
					https_1.nongShangHangPay({
						openId: data_o.openId, // openId
						originalAmount: data_o.chargePrice, // 分
						tradeAmount: data_o.chargePrice // 分
					}).then(res => {
						if (res.code === 0) {
							try {
								location.href = res.data.jsapi_pay_url
							} catch (error) {
								uni.showModal({
									title: '消息提示',
									content: `跳转支付失败,错误码:(${res.code})`,
									confirmColor: that.objColor2.textColor,
									showCancel: false
								});
							}
						} else {
							uni.showModal({
								title: '消息提示',
								content: `${res.msg || '调起支付失败'},错误码:(${res.code})`,
								confirmColor: that.objColor2.textColor,
								showCancel: false
							});
							// 定义支付失败状态
							that.payErr = true
						}
					})
				} else {
					if (WeixinJSBridge) {
						WeixinJSBridge.invoke(
							'getBrandWCPayRequest', data,
							function(res) {
								if (res.err_msg === 'get_brand_wcpay_request:ok') {

								} else {
									// 定义支付失败状态
									that.payErr = true
								}
							})
					} else {
						alert('请在微信环境打开')
					}
				}
			},
			//查询充值结果
			getRechargeResult() {
				uni.showLoading({
					title: '充值中..',
					// mask: true // 测试是关闭遮罩
				})
				// this.getUserMoney();

				// #ifdef H5
				if (this.isCdgj()) {
					this.orderResultQuery()
					// this.searchWxPayApi()
				}
				return
				// #endif

				// #ifdef APP-PLUS
				if (this.sellerConfig.isuseABCPay && this.payType == 'isuseABCPay') {
					console.log('---------------农行支付-充值结果-----------');
					// 农行支付
					this.orderResultQuery()
				} else {
					this.searchWxPayApi()
				}
				// #endif

				// #ifdef MP-WEIXIN
				this.searchWxPayApi()
				// #endif

				// #ifdef MP-ALIPAY
				this.getAliUserMoney()
				// #endif
			},
			getAliUserMoney() {
				var that = this;
				console.log(that.orderNo, '这是支付宝数据')
				if (that.orderNo && that.outTradeNo) {
					https_1.aliOrderResultQuery({
						orderNo: that.orderNo,
						outTradeNo: that.outTradeNo,
					}).then(res => {
						console.log("获取支付结果", res)
						if (res.code == 0) {
							uni.hideLoading()
							// clearInterval(that.Interval);
							if (that.marketingSwitch) {
								that.notificationRecharge();
							}
							that.submitStatus = true
							that.rechargeLoading = false
							that.getRechargeResultNum = 1
							that.customPrice = ''
							that.priceType = 0
							// that.customRechargePrice = 30
							uni.showModal({
								title: '消息提示',
								content: '充值成功',
								confirmColor: that.objColor2.textColor,
								showCancel: false
							});
							that.$emit('getbalance');
						} else {
							that.rollPolingPayStatus()
						}
					}).catch(err => {
						console.log("获取支付结果--fail", err)
						that.rollPolingPayStatus()
						// uni.showModal({
						// 	title: '消息提示',
						// 	content: `${err.msg || '调起支付失败'},错误码:(${err.code})`,
						// 	confirmColor: that.objColor2.textColor,
						// 	showCancel: false
						// });
					})

				} else {
					that.payErr = true
					console.log("充值失败！")
				}
			},


			// 调用微信官方的接口查询查询余额
			searchWxPayApi() {
				let that = this 
				https_1.getWxToken({
					"sellerId": that.sellerId,
					"queryMethod": "GET",
					"url": `https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/${that.orderNo}?mchid=${that.mchid}`,
					"queryBody": "",
					"orderNumber": that.orderNo
				}).then(res => {
					console.log('执行了吗啦啦啦啦啦1', res)
					if (res.code == 0) {
						this.getUserMoney(res.data);
					}
				})
			},

			// 轮询支付状态
			rollPolingPayStatus(data) {
				if(!this.times) {
					this.times = 0
				}


				let that = this
				this.payTime1 = setTimeout(() => {
					// 支付失败状态停止轮询
					console.log("支付失败状态停止轮询", that.payErr, ++this.times)
					if (that.payErr) {
						that.payErr = false
						that.cancelCharge();
						return
					}
					// #ifndef MP-ALIPAY
					this.getUserMoney(data)
					// #endif

					// #ifdef MP-ALIPAY
					this.getAliUserMoney()
					// #endif
				}, 1000)
			},
			orderResultQuery() {
				let that = this
				let reqForm = {
					orderNo: this.orderNo
				}
				this.payApi.orderResultQuery(reqForm).then(function(res) {
						if (res.code == 0) {
							uni.hideLoading()
							// clearInterval(that.Interval);
							if (that.marketingSwitch) {
								that.notificationRecharge();
							}
							// #ifdef H5
							if (that.isCdgj() && that.appH5Time && that.isH5PayCallback) {
								clearTimeout(that.appH5Time)
							}
							// #endif

							that.submitStatus = true
							that.rechargeLoading = false
							that.getRechargeResultNum = 1
							that.customPrice = ''
							that.priceType = 0
							// that.customRechargePrice = 30

							if (that.isCdgj() && that.h5Redirect) {
								// #ifdef H5
								// H5支付重定向
								uni.showModal({
									title: '消息提示',
									content: '充值成功',
									confirmText: '放回上一页',
									confirmColor: that.objColor2.textColor,
									showCancel: false,
									success: function (res) {
										if (res.confirm) {
											const redirectUrl = uni.getStorageSync('RECHARGE_REDIRECT_URL')
											if (redirectUrl) {
												uni.redirectTo({
													url: redirectUrl
												})
											}
										}
									}
								});
								// #endif
							} else if (that.isGoBack) {
								that.goBackPage() // 如：从终端详情进入，充值成功后，需要返回上一页
							} else {
								uni.showModal({
									title: '消息提示',
									content: '充值成功',
									confirmColor: that.objColor2.textColor,
									showCancel: false
								});
							}
						} else {
							// 调用平台查询时才会触发
							that.rollPolingPayStatus()
						}
					}).catch((err) => {
						// 接口报错处理
						// 调用平台查询时才会触发
						console.log("-----------fail-catch----------", err)
						that.rollPolingPayStatus()
					});
			},

			// 返回上一页
			goBackPage() {
				this.goBackTime = setTimeout(() => {
					uni.navigateBack({
						delta: 1
					})
				}, 5000)
				
				uni.showModal({
					title: '消息提示',
					content: '充值成功',
					confirmText: '返回上页',
					showCancel: false,
					success: (res) => {
						if (res.confirm) {
							if (this.goBackTime) {
								clearTimeout(this.goBackTime)
							}
							uni.navigateBack({
								delta: 1
							})
						}
					}
				});
			},

			getUserMoney: function(data) {
				console.log(data, '这是微信数据')
				var that = this;
				if (data) {
					outTradeNo({
						out_trade_no: data.orderNumber,
						mchid: data.mchId,
					}, data.token).then(res => {
						console.log(res, 'fdsafdsaf')
						// "trade_state" : "SUCCESS",
						if (res.trade_state == "SUCCESS") {
							that.orderResultQuery()
						} else {
							that.rollPolingPayStatus(data)
						}
					})
				} else {
					that.orderResultQuery()
				}

				// this.payApi
				// 	.orderResultQuery({
				// 		orderNo: this.orderNo
				// 	})
				// 	.then(function(res) {
				// 		if (res.code === 0) {
				// 			uni.hideLoading()
				// 			// clearInterval(that.Interval);
				// 			if(that.marketingSwitch) {
				// 				that.notificationRecharge();
				// 			}
				// 			that.submitStatus = true
				// 			that.rechargeLoading = false
				// 			that.getRechargeResultNum = 1
				// 			that.customPrice = ''
				// 			that.priceType = 0
				// 			that.customRechargePrice = 30
				// 			uni.showModal({
				// 				title: '消息提示',
				// 				content: '充值成功',
				// 				confirmColor: that.objColor2.textColor, 
				// 				showCancel: false      
				// 			});         
				// 			that.$emit('getbalance');
				// 		}else{
				// 			that.rollPolingPayStatus()
				// 		}
				// 	}).catch(()=>{
				// 		// 接口报错处理
				// 		that.rollPolingPayStatus()
				// 	});
			},
			// 关闭充值异常
			closeRechargeError: function() {
				this.rechargeError = false
			},

			// 充值之前通知营销获客充值成功
			rechargeBefore() {
				console.log('充值之前通知营销获客充值成功');
				rechargeBefore(this.rechargeQuery).then((res) => {
					console.log(res, '充值之前通知营销获客充值成功啦啦啦');
				});
			},

			// 支付成功后通知营销获客充值成功
			notificationRecharge() {
				console.log(this.rechargeQuery, '营销获客通知后端参数');
				console.log('支付成功后通知营销获客充值成功');
				recharge(this.rechargeQuery).then((res) => {
					console.log(res, '支付成功后通知营销获客充值成功啦啦啦');
				});

				// 邀请奖励活动 新用户首次充值 通知后端
				firstRewardSendRecharge(this.rechargeQuery).then((res) => {
					console.log(res, '邀请奖励活动新用户首次充值通知后端...');
				});
			},

			//申请退款
			goRefund: function() {
				uni.navigateTo({
					url: '../refund/refund'
				});
			},

			//收支记录（查看更多）
			goReRecord: function() {
				uni.navigateTo({
					url: '../rechargeRecord/rechargeRecord?accountType=' + this.accountType
				});
			},

			//去充电
			goCharing: function() {
				uni.redirectTo({
					url: '/packageFunctional/sitelist/sitelist'
				});
			}
		}
	};
</script>

<style>
	page {
		background-color: #f2f3f5;
	}
</style>
<style lang="less" scoped>
	/* mine/pages/personalAccount/personalAccount.wxss */
	@import "../../../commin/commin.less";

	* {
		box-sizing: border-box;
	}

	.personalBox {
		padding-bottom: 160rpx;

		.setting {
			.lineheight(60rpx);
			.paddings(35rpx, 32rpx, 37rpx, 32rpx);

			.setting_title {
				display: flex;
				.fontsize(30rpx);
				font-family: PingFang SC;
				font-weight: bold;
				color: @text-color2;

				.tips {
					.fontsize(22rpx);
					color: @text-color4;
					font-weight: normal;
					margin-left: 20rpx;
				}
			}

			.priceType {
				display: flex;
				flex-wrap: wrap;
				align-items: center;
				justify-content: start;

				.type {
					.kuangao(30%, 120rpx);
					.lineheight(120rpx);
					background: #fff;
					box-shadow: 2px 3px 14px 0px rgba(166, 171, 179, 0.14);
					border-radius: 16px;
					text-align: center;
					.fontsize(46rpx);
					font-weight: bold;
					color: #000;
					margin-top: 16rpx;
					position: relative;
					margin-left: 15rpx;

					.icon1 {
						font-size: 24rpx;
					}

					.tips {
						width: 98rpx;
						height: 33rpx;
						position: absolute;
						top: -6rpx;
						left: 0rpx;
					}
				}

				.type-yh {
					&:before {
						content: "充值特惠";
						display: block;
						position: absolute;
						top: -8rpx;
						left: 0;
						width: 98rpx;
						height: 33rpx;
						background: #fc724c;
						border-radius: 16rpx 0px 10rpx 0px;
						text-align: center;
						font-size: 20rpx;
						color: #fff;
						line-height: 33rpx;
					}
				}

				.type-sc {
					&:before {
						content: "首充福利";
						display: block;
						position: absolute;
						top: -8rpx;
						left: 0;
						width: 98rpx;
						height: 33rpx;
						background: var(--textColor);
						text-align: center;
						border-radius: 16rpx 0px 10rpx 0px;
						font-size: 20rpx;
						color: #fff;
						line-height: 33rpx;
					}
				}

				.type_action {
					background: rgba(109, 177, 46, 0.08);
					box-shadow: 2rpx 3rpx 14rpx 0px rgba(166, 171, 179, 0.14);
				}

				.select {
					width: 56rpx;
					height: 56rpx;
					position: absolute;
					bottom: 0;
					right: 0;
					z-index: 9;
				}
			}

			.custom {
				display: flex;
				align-items: center;
				margin-top: 28rpx;
				.fontsize(32rpx);
				font-family: PingFang SC;
				font-weight: 500;
				color: #000;
				width: 100%;
				box-sizing: border-box;
				padding: 0 32rpx;
				height: 95rpx;
				background: #ffffff;
				justify-content: left;
				box-shadow: 2rpx 3rpx 14rpx 0px rgba(166, 171, 179, 0.14);
				border-radius: 16rpx;

				image {
					width: 32rpx;
					height: 32rpx;
				}

				.custom_input {
					width: 85%;
					margin-right: 20rpx;
					margin-left: 15rpx;
				}

				.icon {
					.fontsize(26rpx);
					color: @text-color3;
				}
			}
		}

		.rechargeMessage {
			width: 100%;
			box-sizing: border-box;
			height: 64rpx;
			display: flex;
			align-items: center;
			background: rgba(48, 49, 51, 0.6);
			padding: 0 24rpx;
			justify-content: space-between;
			// position: fixed;
			top: 0rpx;
			left: 0;
			z-index: 999;

			.btn {
				width: 118rpx;
				height: 44rpx;
				background: #f7a14a;
				border-radius: 22rpx;
				font-size: 22rpx;
				color: #fff;
				text-align: center;
				line-height: 44rpx;
			}

			.title {
				width: 60%;
				text-overflow: ellipsis;
				white-space: nowrap;
				overflow: hidden;
				font-size: 24rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
			}

			.info {
				font-size: 22rpx;
				font-family: PingFang SC-Bold, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
			}
		}

		.message {
			width: 100%;
			box-sizing: border-box;
			height: 64rpx;
			display: flex;
			align-items: center;
			background: rgba(252, 114, 76, 0.08);
			padding: 0 24rpx;
			justify-content: space-between;

			.btn {
				width: 118rpx;
				height: 44rpx;
				background: #f7a14a;
				border-radius: 22rpx;
				font-size: 22rpx;
				color: #fff;
				text-align: center;
				line-height: 44rpx;
			}

			.title {
				width: 60%;
				text-overflow: ellipsis;
				white-space: nowrap;
				overflow: hidden;
				font-size: 22rpx;
				font-weight: bold;
				color: #fc724c;
			}

			.info {
				font-size: 22rpx;
				font-weight: 500;
				color: #f7a14a;
			}
		}

		.setting_btn {
			width: 100%;
			height: 120rpx;
			position: fixed;
			background-color: #fff;
			bottom: 0;
			left: 0;
			z-index: 999;
			.kuangao(100%, 120rpx);
			.lineheight(120rpx);
			padding-bottom: 20rpx;
			text-align: center;
			background: #fff;
			border-top: 1rpx solid rgba(177, 182, 190, 0.2);
			display: flex;
			align-items: center;

			.btn {
				width: 686rpx;
				height: 88rpx;
				margin: 0rpx auto;
				margin-top: 10rpx;
				// background: #6DB12E;
				background: var(--btnColor);
				border-radius: 44rpx;
				text-align: center;
				color: #fff;
				font-size: 30rpx;
				line-height: 88rpx;
				font-weight: bold;
			}
		}

		.gift {
			padding: 0 24rpx;

			.t1 {
				font-size: 30rpx;
				color: #303133;
				font-weight: bold;
				margin-bottom: 32rpx;
			}
		}

		.payType {
			margin-top: 32rpx;
			padding: 0 24rpx;
			box-sizing: border-box;

			.title {
				font-size: 30rpx;
				font-weight: bold;
				color: #303133;
				margin-bottom: 32rpx;
			}

			.box {
				width: 100%;
				box-sizing: border-box;
				padding: 39rpx 32rpx;
				background: #ffffff;
				box-shadow: 2rpx 3rpx 14rpx 0px rgba(166, 171, 179, 0.14);
				border-radius: 16rpx;

				.item {
					display: flex;
					margin-bottom: 40rpx;

					.icon {
						width: 80rpx;
						height: 80rpx;
						margin-right: 16rpx;
						border-radius: 50%;
						overflow: hidden;
					}

					.it {
						box-sizing: border-box;
						border-bottom: 1rpx solid rgba(220, 223, 230, 1);
						position: relative;
						width: 84%;
						padding-bottom: 40rpx;

						.t1 {
							font-size: 30rpx;
							font-weight: bold;
							color: #303133;
							margin-bottom: 23rpx;
						}

						.t2 {
							font-weight: 500;
							color: #909399;
							font-size: 24rpx;
						}

						image {
							width: 32rpx;
							height: 32rpx;
							position: absolute;
							z-index: 2;
							right: 0;
							top: 32rpx;
						}
					}

					&:last-of-type {
						margin-bottom: 0;

						.it {
							border-bottom: none;
							padding-bottom: 0;
						}
					}
				}
			}
		}

		.record {
			margin-top: 40rpx;
			font-size: 28rpx;
			font-weight: 500;
			text-decoration: underline;
			color: #909399;
			text-align: center;
			margin-bottom: 100rpx;
			padding-bottom: 50rpx;
		}

		.explain {
			.title {
				.fontsize(34rpx);
				font-family: PingFang SC;
				font-weight: 500;
				color: #303133;
				text-align: center;
				margin-bottom: 40rpx;
			}

			.txt {
				.fontsize(30rpx);
				font-family: PingFang SC;
				font-weight: 500;
				color: @text-color1;
				.lineheight(48rpx);
			}

			.pupBtn {
				width: 100%;
				height: 108rpx;
				.lineheight(108rpx);
				text-align: center;
				position: absolute;
				bottom: 0;
				left: 0;
				color: var(--textColor);
				.fontsize(30rpx);
				font-family: PingFang SC;
				border-top: 1rpx solid #dcdfe6;
			}
		}
	}

	.goCharing {
		align-items: center;
		font-size: 28rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: @blue;
		padding-bottom: 50rpx;
		text-align: center;
	}

	// 充值说明
	.czsm_box {
		font-size: 24rpx;
		font-weight: 500;
		color: #909399;
	}

	.giftBox {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		background: #ffffff;
		box-shadow: 2rpx 3rpx 14rpx 0rpx rgba(166, 171, 178, 0.1412);
		border-radius: 16rpx;
		padding: 26rpx 32rpx;
		box-sizing: border-box;

		.giftItem {
			display: flex;
			padding: 10rpx;
			background: rgba(252, 114, 76, 0.1608);
			border-radius: 8rpx;
			font-size: 22rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: 400;
			color: #fc724c;
			margin: 16rpx 10rpx;
		}
	}
</style>